/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.util;

import ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.*;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see ar.edu.utn.frsf.cidisi.upcolbpip.b2bcollaborations.B2bcollaborationsPackage
 * @generated
 */
public class B2bcollaborationsSwitch<T> {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static B2bcollaborationsPackage modelPackage;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public B2bcollaborationsSwitch() {
		if (modelPackage == null) {
			modelPackage = B2bcollaborationsPackage.eINSTANCE;
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	public T doSwitch(EObject theEObject) {
		return doSwitch(theEObject.eClass(), theEObject);
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(EClass theEClass, EObject theEObject) {
		if (theEClass.eContainer() == modelPackage) {
			return doSwitch(theEClass.getClassifierID(), theEObject);
		}
		else {
			List<EClass> eSuperTypes = theEClass.getESuperTypes();
			return
				eSuperTypes.isEmpty() ?
					defaultCase(theEObject) :
					doSwitch(eSuperTypes.get(0), theEObject);
		}
	}

	/**
	 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @return the first non-null result returned by a <code>caseXXX</code> call.
	 * @generated
	 */
	protected T doSwitch(int classifierID, EObject theEObject) {
		switch (classifierID) {
			case B2bcollaborationsPackage.B2B_COLLABORATION: {
				B2BCollaboration b2BCollaboration = (B2BCollaboration)theEObject;
				T result = caseB2BCollaboration(b2BCollaboration);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.COLLABORATIVE_AGREEMENT: {
				CollaborativeAgreement collaborativeAgreement = (CollaborativeAgreement)theEObject;
				T result = caseCollaborativeAgreement(collaborativeAgreement);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.BUSINESS_GOAL: {
				BusinessGoal businessGoal = (BusinessGoal)theEObject;
				T result = caseBusinessGoal(businessGoal);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.QUANTITATIVE_GOAL: {
				QuantitativeGoal quantitativeGoal = (QuantitativeGoal)theEObject;
				T result = caseQuantitativeGoal(quantitativeGoal);
				if (result == null) result = caseBusinessGoal(quantitativeGoal);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.QUALITATIVE_GOAL: {
				QualitativeGoal qualitativeGoal = (QualitativeGoal)theEObject;
				T result = caseQualitativeGoal(qualitativeGoal);
				if (result == null) result = caseBusinessGoal(qualitativeGoal);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.AGREEMENT_ATRIBUTE: {
				AgreementAtribute agreementAtribute = (AgreementAtribute)theEObject;
				T result = caseAgreementAtribute(agreementAtribute);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.TRADING_PARTNER: {
				TradingPartner tradingPartner = (TradingPartner)theEObject;
				T result = caseTradingPartner(tradingPartner);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.PARTNER_ROLE: {
				PartnerRole partnerRole = (PartnerRole)theEObject;
				T result = casePartnerRole(partnerRole);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.PUBLIC_BUSINESS_INTERFACE: {
				PublicBusinessInterface publicBusinessInterface = (PublicBusinessInterface)theEObject;
				T result = casePublicBusinessInterface(publicBusinessInterface);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.B2B_RELATIONSHIP: {
				B2BRelationship b2BRelationship = (B2BRelationship)theEObject;
				T result = caseB2BRelationship(b2BRelationship);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.BUSINESS_DOCUMENT: {
				BusinessDocument businessDocument = (BusinessDocument)theEObject;
				T result = caseBusinessDocument(businessDocument);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			case B2bcollaborationsPackage.BUSINESS_DOCUMENT_TYPE: {
				BusinessDocumentType businessDocumentType = (BusinessDocumentType)theEObject;
				T result = caseBusinessDocumentType(businessDocumentType);
				if (result == null) result = defaultCase(theEObject);
				return result;
			}
			default: return defaultCase(theEObject);
		}
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>B2B Collaboration</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>B2B Collaboration</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseB2BCollaboration(B2BCollaboration object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Collaborative Agreement</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Collaborative Agreement</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseCollaborativeAgreement(CollaborativeAgreement object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Business Goal</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Business Goal</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBusinessGoal(BusinessGoal object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Quantitative Goal</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Quantitative Goal</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseQuantitativeGoal(QuantitativeGoal object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Qualitative Goal</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Qualitative Goal</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseQualitativeGoal(QualitativeGoal object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Agreement Atribute</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Agreement Atribute</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseAgreementAtribute(AgreementAtribute object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Trading Partner</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Trading Partner</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseTradingPartner(TradingPartner object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Partner Role</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Partner Role</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePartnerRole(PartnerRole object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Public Business Interface</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Public Business Interface</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T casePublicBusinessInterface(PublicBusinessInterface object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>B2B Relationship</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>B2B Relationship</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseB2BRelationship(B2BRelationship object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Business Document</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Business Document</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBusinessDocument(BusinessDocument object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>Business Document Type</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>Business Document Type</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
	 * @generated
	 */
	public T caseBusinessDocumentType(BusinessDocumentType object) {
		return null;
	}

	/**
	 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * <!-- begin-user-doc -->
	 * This implementation returns null;
	 * returning a non-null result will terminate the switch, but this is the last case anyway.
	 * <!-- end-user-doc -->
	 * @param object the target of the switch.
	 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
	 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
	 * @generated
	 */
	public T defaultCase(EObject object) {
		return null;
	}

} //B2bcollaborationsSwitch
